# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=virtualgl
_pkgname=VirtualGL
pkgver=2.6.3
pkgrel=0
pkgdesc="VirtualGL is a toolkit to run remote OpenGL applications with full 3D hardware acceleration."
url="https://virtualgl.org/"
arch="x86_64 ppc64le"
license="LGPL-2.1-or-later"
makedepends="mesa-dev cmake openssl-dev libjpeg-turbo-dev libx11-dev glu-dev libxv-dev
	xcb-util-keysyms-dev libxtst-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/project/virtualgl/$pkgver/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	mkdir -p build && cd build

	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${pkgname} \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib \
		-DCMAKE_INSTALL_BINDIR=/usr/bin \
		-DTJPEG_INCLUDE_DIR=/usr/include \
		-DTJPEG_LIBRARY=/usr/lib/libturbojpeg.so \
		-DOPENGL_glu_LIBRARY=/usr/lib/libGLU.so \
		-DVGL_USESSL=1 \
		-DVGL_FAKEXCB=1 \
		-DVGL_FAKEOPENCL=0
	make
}

package() {
	cd "$builddir/build"
	make  DESTDIR="$pkgdir" install
}

sha512sums="c01c602335d51c94840c32021a5ce4f982939d67efbe1458fce67582c5a76ac42f5b733998a8c8f04a77d57d7c2de01377f7cabcf848c01bfd9b2d8e0b318fea  VirtualGL-2.6.3.tar.gz"
